package com.shujia.day18;

/*
    加入线程：
        public final void join()

 */
class MyThread3 extends Thread {
    @Override
    public void run() {
        for (int i = 1; i <= 200; i++) {
            System.out.println(getName() + "-" + i);
        }
    }
}

public class ThreadDemo3 {
    public static void main(String[] args) throws InterruptedException {
        MyThread3 t1 = new MyThread3();
        MyThread3 t2 = new MyThread3();
        MyThread3 t3 = new MyThread3();


        t1.start();
        t1.join();

        t2.start();
        t3.start();
    }
}
